package com.hb.trade.api.routine;

import cn.hutool.extra.spring.EnableSpringUtil;
import org.apache.shiro.spring.config.web.autoconfigure.ShiroWebFilterConfiguration;
import org.fzzn.core.apidoc.EnableApiDoc;
import org.fzzn.core.auth.shiro.anno.EnableFzznShiro;
import org.fzzn.core.file.anno.EnableFileManage;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 可以发现别的客户端组件，不限于eureka
 *
 * @author zhaojk
 * @apiNote <br>
 * <p>
 * 1: API层不加载数据源
 * 2: 关闭shiro的自动加载，使用自定义配置
 * </p>
 */
@EnableAsync
@EnableApiDoc
@EnableFileManage
@EnableFzznShiro
@EnableSpringUtil
@EnableFeignClients(basePackages = {
        "com.hb.trade.client.*",
        "com.hb.trade.api.routine.client"
})
@EnableDiscoveryClient
@SpringBootApplication(exclude = {
        DataSourceAutoConfiguration.class,
        ShiroWebFilterConfiguration.class
})
@EnableScheduling   // 2.开启定时任务
public class ApiRoutineApplication {

    public static void main(String[] args) {
        SpringApplication.run(ApiRoutineApplication.class, args);
    }

}
